package tw.twandroidproj.app.ui.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;

import tw.twandroidproj.app.R;
import tw.twandroidproj.app.model.Bean;
import tw.twandroidproj.app.model.Company;
import tw.twandroidproj.app.model.ErrorModel;
import tw.twandroidproj.app.network.NetworkManager;
import tw.twandroidproj.app.network.OnResponseListener;

public class details_company_Activity extends AppCompatActivity {

     NetworkManager company_networkManager;
    TextView company_name;
    ImageView company_logo;
    TextView company_address;
    TextView company_intro;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_details_company);
        company_name = (TextView) findViewById(R.id.company_name);
        company_logo = (ImageView) findViewById(R.id.company_logo);
        company_address = (TextView) findViewById(R.id.company_address);
        company_intro = (TextView) findViewById(R.id.company_intro);

        company_networkManager = NetworkManager.getInstance(this);
        company_networkManager.queryCompany("召唤师峡谷监管总局", 1, new OnResponseListener<Bean<Company>>() {
            @Override
            public void onSuccess(Bean<Company> result) {

                company_name.setText(result.getList().get(0).getName());
                company_address.setText(result.getList().get(0).getAddress());
                company_intro.setText(result.getList().get(0).getDescription());
            }

            @Override
            public void onFailed(ErrorModel errorModel) {

            }
        });
    }

}

